<?php
require '../requires.php';
session_start();

$cfg = array(
	'request_token_url' => 'http://www.example.com/framework/OAuth/Server/example/request_token.php',
	'authorize_url' => 'http://www.example.com/framework/OAuth/Server/example/authorize.php',
	'access_token_url' => 'http://www.example.com/framework/OAuth/Server/example/access_token.php',
	'api_url' => 'http://www.example.com/framework/OAuth/Server/example/api.php',
	'authorize_callback' => 'http://www.example.com/framework/OAuth/Client/example/callback.php',
	
	'host' => 'www.example.com',
	'format' => 'json',
	
	'consumer_key' => 'key',
	'consumer_secret' => 'secret',
);

$client = new FrameworkOAuthClient($cfg);
$token = $client->getRequestToken();
if($token) {
	print_r($token);
	$_SESSION['request_token_key'] = $token['oauth_token'];
	$_SESSION['request_token_secret'] = $token['oauth_token_secret'];
}

$auth_url = $client->getAuthorizeUrl($_SESSION['request_token_key'], array('wang' => 'yulin'));
?>
<br />
<a href="<?php echo $auth_url; ?>">Goto Authorize</a>